package itbour.onetouchshow.activity.userinfo;


import com.lsjr.callback.EncryBeanCallBack;
import com.lsjr.utils.HttpUtils;

import java.util.HashMap;

import itbour.onetouchshow.App;
import itbour.onetouchshow.base.mvp.BasePresenterImpl;
import itbour.onetouchshow.constants.AppConfig;
import itbour.onetouchshow.constants.AppConst;
import itbour.onetouchshow.utils.L_;
import itbour.onetouchshow.utils.T_;

/**
 * Created by guoh on 2018/3/27.
 * 功能描述：
 * 需要的参数：
 */

public class VipDetailPresenter extends BasePresenterImpl<VipDetailContract.View> {

    public void loadUserDetailInfo() {
        HashMap<String, Object> stringObjectHashMap = new HashMap<>();
        stringObjectHashMap.put("device", AppConst.ANDROID_DEVICE);
        stringObjectHashMap.put("userId", App.getUserId());
        HttpUtils.getInstance().executeGet(AppConfig.GETUSERDETAILINFO_V1_0, stringObjectHashMap, new EncryBeanCallBack() {
            @Override
            protected void onXError(String exception) {
                L_.e(exception);
                T_.showCustomToast(exception);
            }

            @Override
            protected void onSuccess(String response) {
                // SpUtils.getInstance().saveString(AppConst.USER_INFO, response);
                mvpView.loadUserDetailSuccess(response);
            }
        });
    }


}
